﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CaltechSoft.Service.EntityFW.Entity
{
    public class Po : Entity
    {
        public long ServiceCharges { get; set; }
        public float Tax { get; set; }
        public string QuoteNumber { get; set; }
        public string PoNumber { get; set; }

        public int CompanyId { get; set; }
        public int Status { get; set; }

        public float ExchangeRate { get; set; }
        public DateTime? PODate { get; set; }

        public decimal GrandTotal { get; set; }
        [DataType("decimal(18 ,2")]
        public decimal Vat { get; set; }
        public DateTime? CalibrationDate { get; set; }
        public string Note { get; set; }
        public bool ShowFullName { get; set; }

        public virtual Customer Company { get; set; }
        public virtual Collection<PoItem> Items { get; set; }

        public DateTime? InvoiceDate { get; set; }

        [ForeignKey("UpdatedBy")]
        public virtual User Salesman { get; set; }
        public string ManagerId { get; set; }
        public virtual User Manager { get; set; }
    }

    public class PoItem : Entity
    {
        public int Quantity { get; set; }
        public float UnitPrice { get; set; }
        public int ServicePlace { get; set; }

        public int EquipmentId { get; set; }
        public int PoId { get; set; }

        public virtual Po Po { get; set; }
        public virtual Equipment Equipment { get; set; }
    }
}
